home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 15 / CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso / CUCD / Graphics / Ghostscript / source / gstypes.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-11-10  |  2.4 KB  |  80 lines

  1. /* Copyright (C) 1989, 1995 Aladdin Enterprises.  All rights reserved.
  2.   
  3.   This file is part of Aladdin Ghostscript.
  4.   
  5.   Aladdin Ghostscript is distributed with NO WARRANTY OF ANY KIND.  No author
  6.   or distributor accepts any responsibility for the consequences of using it,
  7.   or for whether it serves any particular purpose or works at all, unless he
  8.   or she says so in writing.  Refer to the Aladdin Ghostscript Free Public
  9.   License (the "License") for full details.
  10.   
  11.   Every copy of Aladdin Ghostscript must include a copy of the License,
  12.   normally in a plain ASCII text file named PUBLIC.  The License grants you
  13.   the right to copy, modify and redistribute Aladdin Ghostscript, but only
  14.   under certain conditions described in the License.  Among other things, the
  15.   License requires that the copyright notice and this notice be preserved on
  16.   all copies.
  17. */
  18.  
  19. /* gstypes.h */
  20. /* Miscellaneous common types for Ghostscript library */
  21.  
  22. #ifndef gstypes_INCLUDED
  23. #  define gstypes_INCLUDED
  24.  
  25. /*
  26.  * Define a type used internally for unique IDs of various kinds
  27.  * (primarily, but not exclusively, character and halftone bitmaps).
  28.  * These IDs bear no relation to any other ID space; we generate them all
  29.  * ourselves.
  30.  */
  31. typedef ulong gs_id;
  32. #define gs_no_id 0L
  33.  
  34. /*
  35.  * Define a sensible representation of a string, as opposed to
  36.  * the C char * type (which can't store arbitrary data, represent
  37.  * substrings, or perform concatenation without destroying aliases).
  38.  */
  39. typedef struct gs_string_s {
  40.     byte *data;
  41.     uint size;
  42. } gs_string;
  43. typedef struct gs_const_string_s {
  44.     const byte *data;
  45.     uint size;
  46. } gs_const_string;
  47.  
  48. /*
  49.  * Define types for Cartesian points.
  50.  */
  51. typedef struct gs_point_s {
  52.     double x, y;
  53. } gs_point;
  54. typedef struct gs_int_point_s {
  55.     int x, y;
  56. } gs_int_point;
  57.  
  58. /*
  59.  * Define a scale for oversampling.  Clients don't actually use this,
  60.  * but this seemed like the handiest place for it.
  61.  */
  62. typedef struct gs_log2_scale_point_s {
  63.     int x, y;
  64. } gs_log2_scale_point;
  65.  
  66. /*
  67.  * Define types for rectangles in the Cartesian plane.
  68.  * Note that rectangles are half-open, i.e.: their width is
  69.  * q.x-p.x and their height is q.y-p.y; they include the points
  70.  * (x,y) such that p.x<=x<q.x and p.y<=y<q.y.
  71.  */
  72. typedef struct gs_rect_s {
  73.     gs_point p, q;            /* origin point, corner point */
  74. } gs_rect;
  75. typedef struct gs_int_rect_s {
  76.     gs_int_point p, q;
  77. } gs_int_rect;
  78.  
  79. #endif                    /* gstypes_INCLUDED */
  80.